﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Models;

namespace MiaoWeiProject.liuyong
{
    public partial class Video : System.Web.UI.Page
    {
        public int c = 1;//小标题的数值
        protected void Page_Load(object sender, EventArgs e)
        {
            string tiaojian = "ZhangjieID=(select FatherID from ZhangjieXiangqi where ZhangjieID="+Request["id"]+")";
            this.Repeater1.DataSource = ZhangjieXiangqiBLL.Allselect(tiaojian);
            this.Repeater1.DataBind();
        }
        protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Repeater dataList = e.Item.FindControl("Repeater2") as Repeater;
                ZhangjieXiangqi rowv = (ZhangjieXiangqi)e.Item.DataItem;
                int ZhangjieID = rowv.ZhangjieID;
                string Sql = " 1=1 and FatherID=" + ZhangjieID;
                ZhangjieXiangqi bll1 = new ZhangjieXiangqi();
                List<ZhangjieXiangqi> model1 = ZhangjieXiangqiBLL.Allselect(Sql);
                if (model1 != null)
                {
                    dataList.DataSource = model1;
                    dataList.DataBind();
                }
            }
        }
    }
}